scrolledwindow: Don't hover the scrollbars while a button is being pressed
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 5 Feb 2015 16:16:21 +0000 (17:16 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 5 Feb 2015 16:24:29 +0000 (17:24 +0100)
This avoids showing the scrollbars if we are positive the child widget
is being manipulated, regardless of the pointer being close to any of these.
On the next motion event after finishing the operation, the scrollbar will
be shown if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=743894

gtk/gtkscrolledwindow.c

index d469668d475af2ea1feab873a3ffa64de7ef0a40..84fa957345e9271da7a65eb24a5e7619c326040f 100644 (file)
@@ -1090,7 +1090,13 @@ captured_event_cb (GtkWidget *widget,
       indicator_start_fade (&priv->hindicator, 1.0);
       indicator_start_fade (&priv->vindicator, 1.0);
 
-      if (strstr (gdk_device_get_name (source_device), "TrackPoint"))
+      if ((event->motion.state &
+           (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) != 0)
+        {
+          indicator_set_over (&priv->hindicator, FALSE);
+          indicator_set_over (&priv->vindicator, FALSE);
+        }
+      else if (strstr (gdk_device_get_name (source_device), "TrackPoint"))
         {
           indicator_set_over (&priv->hindicator, TRUE);
           indicator_set_over (&priv->vindicator, TRUE);